package com.tc.juc.n1;

import lombok.extern.slf4j.Slf4j;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.TimeUnit;

/**
 * @Auther: tianchao
 * @Date: 2021/9/22 21:24
 * @Description:
 */
@Slf4j
public class Async {

    public static void main(String[] args) throws IOException, InterruptedException {
        String path = Async.class.getClassLoader().getResource("").getPath();
        System.out.println(path);
        new FileReader(path+"日志技术 （上）.pdf").read();
        log.info("do other things.");
        Thread t = new Thread(()->{
            while (true){
                Thread thread = Thread.currentThread();
                //log.info(thread.getName());
            }

        },"aaa");
        t.start();
        System.out.println(t.getState());
        //t.join();
       log.info(t.getName());
       Thread.sleep(2000);
        System.out.println(t.getState());
    }
}
